package com.zd.hamster.spring;

import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

//@Configuration
public class ConnectionManageConfig extends WebMvcConfigurationSupport {
	
	/**
	 * 允许跨域上传文件 
	 */
	@Override
	public void addCorsMappings(CorsRegistry registry) {
		registry.addMapping("/**").allowedHeaders("*").allowedMethods("*").allowedOrigins("*");
	}

	/**
	 * 关闭句号后缀匹配视图
	 * 为了获取对应的文件
	 */
//	@Override
//	protected void configurePathMatch(PathMatchConfigurer configurer) {
//		configurer.setUseSuffixPatternMatch(false).setUseTrailingSlashMatch(true);
//	}
	
}